package com.mgface.jersey.exception;

import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.Response.Status;
import javax.ws.rs.ext.ExceptionMapper;
import javax.ws.rs.ext.Provider;

@Provider
public class AppExecptionMapper implements ExceptionMapper<AppException> {

	@Override
	public Response toResponse(AppException exception) {
		return Response.status(Status.NOT_FOUND).entity(new ErrorMessage(exception)).type(MediaType.APPLICATION_JSON)
				.build();
	}

}
